use ash::vk;

use super::{VkSupportedQueue, VkFamilyQueue, VkQueueMap};

impl VkSupportedQueue {
    pub fn get_queue_ci(&self) -> vk::DeviceQueueCreateInfo {
        vk::DeviceQueueCreateInfo {
            queue_family_index      : self.family_index,
            p_queue_priorities      : &1.0f32,
            queue_count             : 1,

            ..Default::default()
        }
    }
}

impl VkFamilyQueue {
    pub fn new(family_index: u32) -> Self {
        VkFamilyQueue {
            family_index        : family_index,
            queue_count         : 0,
            queue_priorities    : vec![]
        }
    }

    pub fn add_queue(&mut self, queue: &VkSupportedQueue) {
        self.queue_count += 1;
        self.queue_priorities.push(queue.queue_priority);
    }

    pub fn get_queue_ci(&self) -> vk::DeviceQueueCreateInfo {
        vk::DeviceQueueCreateInfo {
            queue_family_index      : self.family_index,
            p_queue_priorities      : self.queue_priorities.as_ptr(),
            queue_count             : self.queue_count,

            ..Default::default()
        }
    }
}

impl VkQueueMap {

}